home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / PROGASIC / BASFILES.LZH / QBTXOPEN.BAS < prev    next >
BASIC Source File  |  1988-09-10  |  1KB  |  45 lines

  1. '$INCLUDE:'QBTOOLS.INC'
  2. '' '$INCLUDE: 'qbtools2.inc'
  3. '' '$INCLUDE: 'qbt2indx.inc'
  4. '' '-------------------------Standard Include Merge Section-------------------
  5.  
  6. DEFSNG A-Z
  7.     SUB IndexOpen (IxNum%, hn$, Xnm$(), Xk$(), Xh%()) STATIC
  8.  
  9. '  open the header, read info and close the header
  10.  
  11.         aesbfatal% = 0
  12.  
  13.         IF IxNum% > 20 OR IxNum% < 1 OR IxNum% > UBOUND(Xh%, 1) OR IxNum% < LBOUND(Xh%, 1) THEN
  14.             aesbfatal% = 1
  15.         ELSE
  16.             Xnm$(IxNum%) = hn$
  17.             OPEN "r", IxNum%, hn$ + ".hdr", 512
  18.             FIELD #IxNum%, 32 AS desc$, 32 AS xmast$, 2 AS klen$, 2 AS nok$, 2 AS nexav$
  19.             FIELD #IxNum%, 70 AS twit$, 2 AS kdel$, 440 AS spare$
  20.             GET #IxNum%, 1
  21.  
  22. 'mfile$=xmast$             <--- dont take name from from .HDR
  23.  
  24.             Xh%(IxNum%, 1) = CVI(klen$)
  25.             Xh%(IxNum%, 2) = CVI(nok$)
  26.             Xh%(IxNum%, 3) = CVI(nexav$)
  27.             Xh%(IxNum%, 4) = CVI(kdel$)
  28.             CLOSE IxNum%
  29.  
  30. ' Next line modified to open index file from path\name passed in
  31.             mfile$ = hn$ + ".idx"                                   'Line added to use FILES=
  32.  
  33.             OPEN "r", IxNum%, mfile$, Xh%(IxNum%, 1) + 10
  34.             FIELD #IxNum%, Xh%(IxNum%, 1) AS Xk$(IxNum%, 1), 2 AS Xk$(IxNum%, 2), 2 AS Xk$(IxNum%, 3)
  35.             FIELD #IxNum%, Xh%(IxNum%, 1) + 4 AS twit$, 2 AS Xk$(IxNum%, 4), 2 AS Xk$(IxNum%, 5), 2 AS Xk$(IxNum%, 6)
  36.             LSET Xk$(IxNum%, 1) = STRING$(Xh%(IxNum%, 1), 0)
  37.             FOR init% = 2 TO 6
  38.                 LSET Xk$(IxNum%, init%) = MKI$(0)
  39.             NEXT init%
  40.             PUT #IxNum%, Xh%(IxNum%, 3)
  41.         END IF
  42.  
  43.     END SUB
  44.  
  45.